* Summary of Spatial Mismatch data

********** Table 1 *****************
* Table 1, Column 1: Any new job(s)
tabulate qtr_hire_earndom_00 if qtr==8
* Table 1, Column 2: Single new job, earnings > 75pct old job
tabulate qtr_hire_earndom_75 if qtr==8
* Table 1, Column 3: Single new job, earnings > 90pct old job
tabulate qtr_hire_earndom_90 if qtr==8
* Table 1, Columns 4 and 5: Single new job, earnings > 75pct old job
* Column 4: Job accessibility <-0.5 if acc_c<-.375
* Column 5: Job accessibility > 0.5 if acc_c> .375
tabulate qtr_hire_earndom_75 acc_c if qtr==8
*******************************************
tabulate qtr_hire_earndom_00 acc_c if qtr==8
tabulate qtr_hire_earndom_90 acc_c if qtr==8
tabulate qtr_hire_earn_00 if qtr==8
tabulate qtr_hire_earn_75 if qtr==8
tabulate qtr_hire_earn_90 if qtr==8
tabulate qtr_hire_earnfull_00 if qtr==8
tabulate qtr_hire_earnfull_75 if qtr==8
tabulate qtr_hire_earnfull_90 if qtr==8

********** Table 2, Column 1; Also Table D2 *****************
tabulate qtr
* grp_c=[1,2,3,4] for [white,black,hisp,other]
tabulate grp_c if qtr==8
* met_central indicates largest county in MPO, central_tract indicates largest city
tabulate met_central central_tract if qtr==8
tabulate grp_c if qtr==8 & met_central==1 & central_tract==1
tabulate grp_c if qtr==8 & met_central==1 & central_tract==0
tabulate grp_c if qtr==8 & met_central==0 & central_tract==0
tabulate grp_c st if qtr==8 & met_central==1 & central_tract==1
tabulate grp_c st if qtr==8 & met_central==1 & central_tract==0
tabulate grp_c st if qtr==8 & met_central==0 & central_tract==0
* female=[0,1] for [male,female]
tabulate female if qtr==8
* age_c=[1,2,3] for [age>=20 and age<35,age>=35 and age<55,age>=55 and age<65]
tabulate age_c3 if qtr==8
* primeearn=[1,2,3] for [married and earn>50pct,married and earn<50pct, not married]
tabulate primeearn if qtr==8
* earn_c=[1,2,3,4,5] for [15000<=earntotall<20000,20000<=earntotall<25000,25000<=earntotall<30000,
*                         30000<=earntotall<35000,35000<=earntotall<=40000]                        
tabulate earn_c  if qtr==8
* sep_sec_c=[1,2,3,4,5] for [
*    	'11','21','22','23','31'-'33','42','48'-'49'=1
*       '44'-'45','56','71','72','81'=2
*    	'51','52','53','54','55'=3
*       '61','92'=4
*       '62'=5
*       ]
tabulate sep_sec_c if qtr==8
*******************************************
************ Table D2 *********************
* sep_year=[2000,2001,2002,2003,2004,2005]
tabulate sep_year if qtr==8
* sep_time_0020=[0,1] for [time > 20 minutes,time < 20 minutes]
* sep_time_40up=[0,1] for [time < 40 minutes,time > 40 minutes]
tabulate sep_time_0020 sep_time_40up if qtr==8
sum  earntotallhu   earntotall   earndom   earndom_m0 if qtr==8
sum  tenuredom jobcount_hist if qtr==8
sum  com_pub_rate poverty_rate owner_rate pop_sq_mile build_age_med
*******************************************

* other summaries of categorical variables
tabulate married if qtr==8
tabulate age_c if qtr==8
tabulate stmet_name if qtr==8
tabulate st if qtr==8
tabulate earndomshare_c  if qtr==8
tabulate tenuredom if qtr==8
tabulate sep_seas if qtr==8
tabulate sep_prox if qtr==8

************ Figure D1 *******************
tabulate acc_c if qtr==8
******************************************
tabulate acc_c if qtr==8 & grp_white==1
tabulate acc_c if qtr==8 & grp_black==1
tabulate acc_c if qtr==8 & grp_hisp==1
tabulate acc_c if qtr==8 & grp_other==1
tabulate acc_c stmet_name if qtr==8
tabulate transit_feas if qtr==8
tabulate tract_transit_mpo tract_transit_census if qtr==8
tabulate transit_feas stmet_name if qtr==8

* summary of other variables
sum  earning earningln earningln1 if qtr==8
sum  earntotallhu   earntotall   earndom   earndom_m0 if qtr==8
sum  earntotallhuln earntotallln earndomln earndomsepln if qtr==8
sum  tenuredom jobcount_hist if qtr==8
sum  pop2000 ///
     poverty_rate owner_rate pop_sq_mile build_age_med com_pub_rate ///
     emp_rate edu_hs_rate assist_rate com_veh_rate veh_0_rate

tabstat earntotall earntotallhu earning, statistics(mean) by(primeearn) columns(variables)
tabstat grp_black grp_hisp female earndom, statistics(mean) by(acc_c) columns(variables)
tabstat pauto ptran_avg, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)

*********** Table F1: Relationship of Access Ratio Measures, by Travel Time *******
******** Table F1, Panel A: Variances/Covariances *******
correlate ratio_auto_all_10 ratio_tran_all_10 ratio_predboth_all_10 ///
          ratio_predauto_all_10 ratio_predtran_all_10 ratio_predfeas_all_10 ///
          if qtr==8, covariance
******** Table F1, Panel B: Correlation *******
correlate ratio_auto_all_10 ratio_tran_all_10 ratio_predboth_all_10 ///
          ratio_predauto_all_10 ratio_predtran_all_10 ratio_predfeas_all_10 ///
          if qtr==8
**********************************************************************************

* partial correlations
pcorrmat  ratio_auto_all_10 ratio_tran_all_10 ratio_predboth_all_10 ///
          ratio_predauto_all_10 ratio_predtran_all_10 ratio_predfeas_all_10 ///
          if qtr==8, part(inind midet ohcol ohcle mnmin papit nybuf wimil)
pcorrmat  ratio_predfeas_all_10 ///
          poverty_rate owner_rate pop_sq_mile build_age_med com_pub_rate ///
          if qtr==8, part(inind midet ohcol ohcle mnmin papit nybuf wimil)
pcorrmat  ratio_predfeas_all_10 earntotallhu   earntotall   earndom ///
          if qtr==8, part(inind midet ohcol ohcle mnmin papit nybuf wimil)

* check if same group variables are correlated
correlate ratio_predfeas_all_10 ratio_predfeas_gp1_10 ratio_predfeas_gp2_10 ///
          if qtr==8, covariance
pcorrmat  ratio_predfeas_all_10 ratio_predfeas_gp1_10 ratio_predfeas_gp2_10 ///
          if qtr==8, part(inind midet ohcol ohcle mnmin papit nybuf wimil)
correlate ratio_predfeas_all_5 ratio_predfeas_gp1_5 ratio_predfeas_gp2_5 ///
          if qtr==8, covariance
pcorrmat  ratio_predfeas_all_5 ratio_predfeas_gp1_5 ratio_predfeas_gp2_5 ///
          if qtr==8, part(inind midet ohcol ohcle mnmin papit nybuf wimil)
correlate ratio_predfeas_all_10 ratio_predfeas_sc1_10 ratio_predfeas_sc2_10 ///
          if qtr==8, covariance
pcorrmat  ratio_predfeas_all_10 ratio_predfeas_sc1_10 ratio_predfeas_sc2_10 ///
          if qtr==8, part(inind midet ohcol ohcle mnmin papit nybuf wimil)

* check relationship of predicted and auto
reg ratio_predfeas_all_10 ratio_auto_all_10, robust
reg ratio_predfeas_all_10 ratio_auto_all_10 pauto , robust

************* Table 2, Columns 2-5 *************
* ratio_predfeas_all_10: Job accessibility, see Equation (3)
* median: p50
* 25th pct: p25
* 75th pct: p75
* Interquartile Range: p75-p25

* calculate distributions of access variables for various populations
local vars_a="ratio_predfeas_all_10 index_predfeas_all_10up_ex indcs_predfeas_all_10up_ex"
local vars_b="ratio_predfeas_all_10"
local vars_c="ratio_predfeas_eall_10 index_predfeas_eall_10up_ex indcs_predfeas_eall_10up_ex ratio_auto_all_10 ratio_predboth_all_10 ratio_dist_all_1"

gen tabuse=0

replace tabuse=1 if qtr==8
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_c' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & grp_white==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & grp_black==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & grp_hisp==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & grp_other==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==1 & central_tract==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==1 & central_tract==0
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==0 & central_tract==0
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==1 & central_tract==1 & grp_white==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==1 & central_tract==0 & grp_white==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==0 & central_tract==0 & grp_white==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==1 & central_tract==1 & grp_black==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==1 & central_tract==0 & grp_black==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==0 & central_tract==0 & grp_black==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==1 & central_tract==1 & grp_hisp==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==1 & central_tract==0 & grp_hisp==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==0 & central_tract==0 & grp_hisp==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==1 & central_tract==1 & grp_other==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==1 & central_tract==0 & grp_other==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & met_central==0 & central_tract==0 & grp_other==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & female==0
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & female==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & age_c==1 | qtr==8 & age_c==2
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & age_c==3 | qtr==8 & age_c==4
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & age_c==5
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & primeearn==0
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & primeearn==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & primeearn==2
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & earn_c==1 | qtr==8 & earn_c==2 | qtr==8 & earn_c==3
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & earn_c==4 | qtr==8 & earn_c==5
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & sep_sec_c==1
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & sep_sec_c==2
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & sep_sec_c==3
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & sep_sec_c==4
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

replace tabuse=1 if qtr==8 & sep_sec_c==5
tabstat `vars_a' if tabuse==1, statistics(n mean sd) columns(statistics) format(%8.0g)
tabstat `vars_b' if tabuse==1, statistics(min p10 p25 p50 p75 p90 max) columns(statistics) format(%5.3g)
replace tabuse=0

********************************************
